package org.jet.common.comp;

import java.io.File;
import java.util.Random;

public class PathGenerator {

    private Random random = new Random();

    char [] chars = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".toCharArray();

    private StringBuilder sb = new StringBuilder();

    public synchronized String randomString(){
        int len = random.nextInt(3) + 2;
        sb.delete(0,sb.length());
        for(int i=0;i<len;i++){
            int index = random.nextInt(chars.length);
            sb.append(chars[index]);
        }
        return sb.toString();
    }



    public  String generate(){
        StringBuffer stringBuffer = new StringBuffer("n2/");
        for(int i=0;i<4;i++){
            stringBuffer.append(randomString());
            stringBuffer.append(File.separatorChar);
        }
        return stringBuffer.toString();
    }
}
